#ifndef CHECKCONSTRAINT_H
#define CHECKCONSTRAINT_H

#include "tableconstraint.h"
#include "booleanExpression.h"

// forward declaration:
class ColumnList;
class Column;

/*
  Class: PrimaryKeyConstraint
  Storage the columns than compose the primary key of an SQL table.
*/
class CheckConstraint : public TableConstraint
{
  /* Section: public */
 public:
  /*
    Constructor: Default constructor.
    Initializes the object.
  */
  CheckConstraint( BooleanExpression * expr = NULL, string tableName = "");

  /*
    Destructor: Default destructor.
    Destroy the object.
  */
  virtual ~CheckConstraint();

  /*
    Constructor: Copy constructor.
    Initializes the object as a copy from other PrimaryKeyConstraint object.

    Parameter:
    other   -   PrimaryKeyConstraint to copy from.
  */
  CheckConstraint(const CheckConstraint& other);

  /*
    Method: getExpression
    returns the Boolean expresion of the check constraint
  */
  inline BooleanExpression * getExpression(){return expr;};

  void setTableName(string tableName);

  
  virtual string toString();

  /*
    Method: Clone

    See also:
    TableConstraint
  */
  virtual TableConstraint * clone();

  /* Section: private */

 private:
  BooleanExpression * expr;
};

#endif // PRIMARYKEYCONSTRAINT_H
